package com.ruoyi.group.service.impl;

import java.util.List;

import com.ruoyi.group.domain.GoodsCategory;
import com.ruoyi.group.service.IGoodsCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.group.mapper.BusGoodsMapper;
import com.ruoyi.group.domain.BusGoods;
import com.ruoyi.group.service.IBusGoodsService;

/**
 * 物品信息Service业务层处理
 *
 * @author ruoyi
 * @date 2022-11-28
 */
@Service
public class BusGoodsServiceImpl extends ServiceImpl<BusGoodsMapper, BusGoods> implements IBusGoodsService {

    @Autowired
    private IGoodsCategoryService goodsCategoryService;
    /**
     * 查询物品信息列表
     *
     * @param busGoods 物品信息
     * @return 物品信息
     */
    @Override
    public List<BusGoods> selectBusGoodsList(BusGoods busGoods) {
        if (busGoods.getCategoryId() != null) {
            String categoryId = busGoods.getCategoryId();
            GoodsCategory category = goodsCategoryService.getById(Long.valueOf(categoryId));
            category.getParams().put("busiPath",category.getBusiPath());
        }
        return getBaseMapper().selectBusGoodsList(busGoods);

    }

    @Override
    public void removeBatchById(String[] ids) {

    }
}
